/*
 * Copyright (C) 2021 Fastjrun, Inc. All Rights Reserved.
 */
package com.fastjrun.xxl.job.api.helper;

import com.fastjrun.xxl.job.api.dto.XxlJobInfoDTO;
import com.fastjrun.xxl.job.api.entity.XxlJobInfo;

public class DTOToEntifyConverter {
    public static final XxlJobInfo convert(XxlJobInfoDTO xxlJobInfoDTO) {
        XxlJobInfo xxlJobInfo = new XxlJobInfo();
        xxlJobInfo.setJobGroup(xxlJobInfoDTO.getJobGroup());
        xxlJobInfo.setJobDesc(xxlJobInfoDTO.getJobDesc());
        xxlJobInfo.setAuthor(xxlJobInfoDTO.getAuthor());

        xxlJobInfo.setScheduleType(xxlJobInfoDTO.getScheduleType());
        xxlJobInfo.setScheduleConf(xxlJobInfoDTO.getScheduleConf());

        xxlJobInfo.setGlueType(xxlJobInfoDTO.getGlueType());
        xxlJobInfo.setExecutorHandler(xxlJobInfoDTO.getExecutorHandler());
        xxlJobInfo.setGlueSource(xxlJobInfoDTO.getGlueSource());
        xxlJobInfo.setExecutorRouteStrategy(xxlJobInfoDTO.getExecutorRouteStrategy());
        xxlJobInfo.setMisfireStrategy(xxlJobInfoDTO.getMisfireStrategy());
        xxlJobInfo.setExecutorBlockStrategy(xxlJobInfoDTO.getExecutorBlockStrategy());


        xxlJobInfo.setChildJobid(xxlJobInfoDTO.getChildJobId());

        xxlJobInfo.setAlarmEmail(xxlJobInfoDTO.getAlarmEmail());
        xxlJobInfo.setExecutorParam(xxlJobInfoDTO.getExecutorParam());
        xxlJobInfo.setExecutorTimeout(xxlJobInfoDTO.getExecutorTimeout());
        xxlJobInfo.setExecutorFailRetryCount(xxlJobInfoDTO.getExecutorFailRetryCount());
        xxlJobInfo.setGlueRemark(xxlJobInfoDTO.getGlueRemark());

        return xxlJobInfo;

    }
}
